package com.service.impl;

import com.dao.HistDAO;
import com.entity.Hist;
import com.service.HistService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("histService") //
public class HistServiceImpl implements HistService {
    @Autowired // 它可以对类成员变量、方法及构造函数进行标注，完成自动装配的工作
    private HistDAO histDAO;

    @Override // 继承接口的新增浏览记录表数据 返回值0(失败),1(成功)
    public int insertHist(Hist hist) {
        return this.histDAO.insertHist(hist);
    }

    @Override // 继承接口的更新浏览记录表数据 返回值0(失败),1(成功)
    public int updateHist(Hist hist) {
        return this.histDAO.updateHist(hist);
    }

    @Override // 继承接口的按主键删除浏览记录表数据 返回值0(失败),1(成功)
    public int deleteHist(String histid) {
        return this.histDAO.deleteHist(histid);
    }

    @Override // 继承接口的批量删除浏览记录表数据 返回值0(失败),大于0(成功)
    public int deleteHistByIds(String[] ids) {
        return this.histDAO.deleteHistByIds(ids);
    }

    @Override // 继承接口的查询浏览记录表全部数据
    public List<Hist> getAllHist() {
        return this.histDAO.getAllHist();
    }

    @Override // 继承接口的按条件精确查询浏览记录表数据
    public List<Hist> getHistByCond(Hist hist) {
        return this.histDAO.getHistByCond(hist);
    }

    @Override // 继承接口的按条件模糊查询浏览记录表数据
    public List<Hist> getHistByLike(Hist hist) {
        return this.histDAO.getHistByLike(hist);
    }

    @Override // 继承接口的按主键查询浏览记录表数据 返回Entity实例
    public Hist getHistById(String histid) {
        return this.histDAO.getHistById(histid);
    }

}

